package com.study.json;

import com.alibaba.fastjson.JSON;
import com.study.json.entity.Feature;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class FastJson {
    public static void main(String[] args){
        try(Stream<String> lines = Files.lines(Paths.get("src/main/resources/feature.json"))){
            String content = lines.collect(Collectors.joining());
            Feature feature = JSON.parseObject(content, Feature.class);

            String fString = JSON.toJSONString(feature, true);
            System.out.println(fString);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
